Skip to content

0.9.2: content-checked caches, safer checks and gc, rewrite tests, benchmark of 0.9.2 - #2

Merged
chteau merged 10 commits into
masterfrom
0.9.2
Oct 12, 2026
Merged

chteau merged 10 commits into
masterfrom
0.9.2

Conversation

@chteau

@chteau chteau commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Second part of 0.9.2, on top of #1.

  • Plugin disabled: the proxy takes tokenforge's settings out when tokenforge@… is set to false and puts them back on the next session after it is enabled again.
  • Caches: the tmap index (tmap 0.5.2, released as tmap-v0.5.2) and the instruction cache check file content, not only size and mtime; every cache write is atomic; tforge caches lists each cache and what it depends on.
  • Checks and gc: a check that times out is killed with its whole process tree; verifyTimeoutMin: 0 is refused; checks that write into the repo are reported; gc never follows a symlink out of its temp dir and re-checks each dir before deleting it.
  • Bash router: property and differential tests (no bug found), tkit test compared with the runner it replaces, mid-log errors kept, TFORGE_SHOW_REWRITE and tforge route.
  • Reads: the proxy prunes a read of a file edited since, once the file is untouched for 6 calls (−5.6% of re-sent reads on 90 replayed sessions).
  • Orchestration: tforge validate recommends workers or inline work from the plan's shape.
  • Profiling: no bottleneck (hooks 31–60 ms, tmap 14 ms warm, proxy 50 ms at 1,000 tool calls).
  • Benchmark (Claude Code 2.1.296, 37 tasks, 2 runs per side at the defaults): median −51% tokens and −28% list cost per task, fewer tokens and lower cost on all 37, quality 98.6 vs 98.9. Lean levels on 6 tasks: on −37%, balanced −47%, max −44%, ultra −55%. README, charts, report, roadmap and changelog updated.

npm test: 180 pass, 1 skipped. CI green on 95a7a17.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT

chteau and others added 10 commits October 12, 2026 02:25
…t them back on re-enable

Claude Code does not tell a plugin it was disabled, so lean's deny list, skill overrides,
autoCompactWindow and ANTHROPIC_BASE_URL stayed in settings.json. The proxy daemon now checks
enabledPlugins at most every 30 s and removes only what tokenforge added; session-start restores it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
… content

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
… (tforge caches)

- tmap 0.5.2: an entry is kept on unchanged size/mtime/ctime/inode only when indexed 2 s after
  the file's last write (racy-git rule); otherwise a content hash decides. Same bytes rewritten
  are not re-parsed; an index from another tmap version is rebuilt. Rust tests no longer race on
  TMAP_CACHE_DIR.
- Instruction blocks keyed by content and parser version, not size and mtime.
- Session index and dashboard notice a transcript replaced at the same size (first-block hash).
- writeFileAtomic for every cache and state file that was written in place.
- lib/caches.mjs: every cache with its kind (computation / memory / provider) and dependencies.
- Tests: same-stat edits, renames, deletions, torn entries, concurrent writers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
…ough a symlink

- runShell: checks lead their own process group; the timeout kills the tree (taskkill /T on
  Windows) and stops waiting for pipes a stray grandchild holds. Groups die with the driver.
- Plan numbers (timeouts, retries, turns, budget, inline size) are bounded; 0 or "10" used to
  disable the check timeout.
- A check's writes in the checkout are reported (log, ledger checkWrites).
- gc: scratch root, project and session dirs must be real dirs owned by the user (a symlinked
  project dir was followed); victims are moved aside and re-checked (registry, open files,
  writes) before deletion; stale lock taken over by rename; interrupted-gc leftovers removed;
  /proc that hides our own fds means no eviction.
- tforge lean shows what the level hides; README on deny scope.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
…REWRITE and tforge route

- test/rewrite-property.test.mjs: seeded generator over quoting, globs, spaced paths, env
  prefixes, substitutions, pipes, redirections and exit chains; each rewrite must exit, write
  files and print lines like the original (6 extra seeds x 300 cases clean).
- tkit test compared with npm test (pytest where installed): exit code, pass/fail counts,
  failing test and load error named, fewer lines. Subprocesses drop NODE_TEST_CONTEXT.
- tkit run cap: a failed run keeps up to 20 error lines from the omitted middle.
- TFORGE_SHOW_REWRITE=1|ask (systemMessage to the user; ask = permission prompt with the
  exact rewrite); tforge route "<cmd>" prints a rewrite without running it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
…recorded sessions

- bench/scripts/read-replay.mjs: replays recorded stream.jsonl (no API calls): per cat / sed -n /
  head / tail / Read, result sizes, re-sends, re-reads, and what followed an edit of the file.
  90 ultra+proxy sessions: cat 64% of tool-result chars, sed -n 23%; only 22 sed -n results
  over 4k (3%), so sed -n ranges are not folded.
- prune: shellEdits() sees tkit edit / sed -i / tee / cat > inside a command. A read of a file
  edited since now goes in the current turn too once the file was untouched for 6 calls
  (EDITED_READ_AGE); claude -p sessions are one turn, so the earlier-turn rule never applied.
  Simulated on the same sessions: -5.6% of re-sent read content, no edit without a re-read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
…hes were recorded

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
strategyAdvice(): inline for fewer than 5 files or 3 tasks, a serial chain of up to 5 tasks, or
tasks that each start with most of the planned context; workers otherwise. Printed by validate,
followed by the forge skill unless the user asked for workers. Thresholds from earlier
measurements; the strategy benchmark will tune them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
… roadmap: no bottleneck

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
…ution

Claude Code 2.1.296, 2 runs per side on every task: median -51% tokens and
-28% list cost per task, cheaper on all 37, quality 98.6 vs 98.9. Lean
levels on 6 tasks: on -37%, balanced -47%, max -44%, ultra -55%; ultra with
the proxy -53.9%. README tables, charts, report and roadmap now show these
runs; charts draw only runs on the Claude Code version under test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Qx4xQdY1hCQkSjJ5iuZFFT
@chteau chteau self-assigned this Oct 12, 2026
@chteau chteau added the enhancement New feature or request label Oct 12, 2026
@chteau
chteau merged commit a724616 into master Oct 12, 2026
35 checks passed
@chteau
chteau deleted the 0.9.2 branch October 12, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant